\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene}{
\section{Zebulon::GeneticAlgorithms::Gene Class Reference}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene}\index{Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}}
}


Structure for representing a gene within a chromosome used in a genetic algorithm.  


{\ttfamily \#include $<$gene.h$>$}\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_abedccac032d647ec6a1d538f53fabf45}{
typedef std::vector$<$ \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene}{Gene} $\ast$ $>$ {\bfseries Vector}}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_abedccac032d647ec6a1d538f53fabf45}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene}{Gene} $\ast$ \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_a39cd08b063bb8c7eaacf180e459d696d}{Clone} () const =0
\item 
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_a9aa2d29207dd83e89066ccc83feb9c6f}{
virtual int \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_a9aa2d29207dd83e89066ccc83feb9c6f}{Write} (FILE $\ast$fp) const }
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_a9aa2d29207dd83e89066ccc83feb9c6f}

\begin{DoxyCompactList}\small\item\em Write gene information to a file. It is up to the developer to choose file format. \item\end{DoxyCompactList}\item 
virtual int \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_a16ee5e5bac3fc738932fa7efd36ee74a}{Write} (CxUtils::Packet \&packet) const 
\begin{DoxyCompactList}\small\item\em Write gene information within a packet structure. This is useful for developing applications requiring distribution of processing over a network. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_afaff54510a39e980f085c809c693bf0c}{
virtual int \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_afaff54510a39e980f085c809c693bf0c}{Read} (FILE $\ast$fp)}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_afaff54510a39e980f085c809c693bf0c}

\begin{DoxyCompactList}\small\item\em Read gene information from a file based on format chosen using the Write method. \item\end{DoxyCompactList}\item 
virtual int \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_a854cd61b32d06b967b2316d032aebf4b}{Read} (const CxUtils::Packet \&packet)
\begin{DoxyCompactList}\small\item\em Read gene information within a packet structure. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{class_zebulon_1_1_genetic_algorithms_1_1_gene_ac01536838cd24501fc7e5cc49d68af5e}{Mutate} (const double mutationRate)=0
\begin{DoxyCompactList}\small\item\em Apply mutation to your gene based on the rate provided. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Structure for representing a gene within a chromosome used in a genetic algorithm. Inherit from this class, overloading the virtual methods to add functionality for networked distribution, and automatic saving of your solutions with this library. 

\subsection{Member Function Documentation}
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_a39cd08b063bb8c7eaacf180e459d696d}{
\index{Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}!Clone@{Clone}}
\index{Clone@{Clone}!Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}}
\subsubsection[{Clone}]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Gene}$\ast$ Zebulon::GeneticAlgorithms::Gene::Clone () const\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_a39cd08b063bb8c7eaacf180e459d696d}
\begin{DoxyReturn}{Returns}
A duplicate of your gene data. 
\end{DoxyReturn}
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_ac01536838cd24501fc7e5cc49d68af5e}{
\index{Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}!Mutate@{Mutate}}
\index{Mutate@{Mutate}!Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}}
\subsubsection[{Mutate}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool Zebulon::GeneticAlgorithms::Gene::Mutate (const double {\em mutationRate})\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_ac01536838cd24501fc7e5cc49d68af5e}


Apply mutation to your gene based on the rate provided. 
\begin{DoxyParams}{Parameters}
\item[{\em mutationRate}]Mutation rate to use. \end{DoxyParams}
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_a854cd61b32d06b967b2316d032aebf4b}{
\index{Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}!Read@{Read}}
\index{Read@{Read}!Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}}
\subsubsection[{Read}]{\setlength{\rightskip}{0pt plus 5cm}virtual int Zebulon::GeneticAlgorithms::Gene::Read (const CxUtils::Packet \& {\em packet})\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_a854cd61b32d06b967b2316d032aebf4b}


Read gene information within a packet structure. 
\begin{DoxyParams}{Parameters}
\item[{\em packet}]Packet buffer to de-\/serialize data from.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of bytes read. 
\end{DoxyReturn}
\hypertarget{class_zebulon_1_1_genetic_algorithms_1_1_gene_a16ee5e5bac3fc738932fa7efd36ee74a}{
\index{Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}!Write@{Write}}
\index{Write@{Write}!Zebulon::GeneticAlgorithms::Gene@{Zebulon::GeneticAlgorithms::Gene}}
\subsubsection[{Write}]{\setlength{\rightskip}{0pt plus 5cm}virtual int Zebulon::GeneticAlgorithms::Gene::Write (CxUtils::Packet \& {\em packet}) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{class_zebulon_1_1_genetic_algorithms_1_1_gene_a16ee5e5bac3fc738932fa7efd36ee74a}


Write gene information within a packet structure. This is useful for developing applications requiring distribution of processing over a network. 
\begin{DoxyParams}{Parameters}
\item[{\em packet}]Packet buffer to serialize data to.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of bytes written. 
\end{DoxyReturn}


The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/zebml/include/ga/\hyperlink{gene_8h}{gene.h}\end{DoxyCompactItemize}
